package com.google.code.stalkernet.message;

/**
 * Message to deliver between Stalker.Net peers.
 *
 * @author Mikhail Vladimirov
 */
public interface Message
{
    /**
     * Get type of the message.
     *
     * @return type of the message
     */
    public MessageType getType ();

    /**
     * Accept given {@link MessageVisitor}.
     *
     * @param <T> visit result type
     * @param messageVisitor {@link MessageVisitor} to accept
     * @return visit result
     */
    public <T> T accept (MessageVisitor <T> messageVisitor);
}
